<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for DomUser.domar.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file DomUser.domar.php</h1>
<p>Documentation is available at <a href="../DomAuth/_libs---DomAuth---DomUser.domar.php.html">DomUser.domar.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php&nbsp;</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;tableName&nbsp;users</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;DomAuth</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Oliver&nbsp;Leisalu,&nbsp;Inditel&nbsp;Meedia</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-key">class&nbsp;</span><a href="../DomAuth/DomUser.html">DomUser</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../DomAr/DomArObject.html">DomArObject</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a8"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a9"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;char(25)&nbsp;unique</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;validator&nbsp;length(3,25)</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$username">$username</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;password(6,2)&nbsp;not&nbsp;empty</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$password">$password</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;email&nbsp;not&nbsp;empty&nbsp;unique</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$email">$email</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;char(25)</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$firstName">$firstName</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;char(25)</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$lastName">$lastName</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;plugin&nbsp;DomArAcl</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$rights">$rights</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;plugin&nbsp;DomArDateTime(now)</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$registered">$registered</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;plugin&nbsp;DomArDateTime(now)</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$lastLogin">$lastLogin</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;plugin&nbsp;DomArDateTime(now)</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$lastAction">$lastAction</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;bool</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$blocked">$blocked</a>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;text</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$blockReason">$blockReason</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;bool</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$rulesAccepted">$rulesAccepted</a>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@orm</span><span class="src-doc">&nbsp;bool</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><a href="../DomAuth/DomUser.html#var$emailConfirmed">$emailConfirmed</a>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../DomAuth/DomUser.html#constSESSION_VAR">SESSION_VAR</a>&nbsp;=&nbsp;<span class="src-str">'loggedInUser'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodinitLoaded">initLoaded</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;update&nbsp;lastAction&nbsp;time&nbsp;if&nbsp;needed.</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#methodloggedIn">loggedIn</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastAction">lastAction</a><span class="src-sym">-&gt;</span><span class="src-id">stamp</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>+&nbsp;<span class="src-num">120&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">'now'</span><span class="src-sym">)&nbsp;)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$time&nbsp;</span>=&nbsp;<a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">'now'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastAction">lastAction</a>&nbsp;=&nbsp;<span class="src-var">$time</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodsetChanged">setChanged</a><span class="src-sym">(</span><span class="src-str">'lastAction'</span><span class="src-sym">,</span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomSql/DomSql.html">DomSql</a></span><span class="src-sym">::</span><a href="../DomSql/DomSql.html#methodquery">query</a><span class="src-sym">(</span><span class="src-str">'UPDATE&nbsp;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodgetDbTable">getDbTable</a><span class="src-sym">(</span><span class="src-sym">)</span>.<span class="src-str">'&nbsp;SET&nbsp;lastAction=\''</span>.<a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">'Y-m-d&nbsp;H:i:s'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$time</span><span class="src-sym">)</span>.<span class="src-str">'\'&nbsp;WHERE&nbsp;id&nbsp;=&nbsp;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id</span>.<span class="src-str">'&nbsp;LIMIT&nbsp;1'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodgetValidationErrorMessages">getValidationErrorMessages</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'username'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Kasutajanimi&nbsp;ei&nbsp;ole&nbsp;sobiv!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Kasutajanimi&nbsp;on&nbsp;juba&nbsp;võetud!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">107&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Kasutajanimi&nbsp;on&nbsp;liiga&nbsp;pikk&nbsp;või&nbsp;liiga&nbsp;lühike!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'email'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Email&nbsp;ei&nbsp;ole&nbsp;sobiv!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">2&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Email&nbsp;on&nbsp;juba&nbsp;võetud!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">3&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Emaili&nbsp;sisestamine&nbsp;on&nbsp;kohustuslik!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">4&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Emailid&nbsp;ei&nbsp;kattu!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'password'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Parool&nbsp;ei&nbsp;ole&nbsp;sobiv!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">3&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Parooli&nbsp;sisestamine&nbsp;on&nbsp;kohustuslik!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">4&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Paroolid&nbsp;ei&nbsp;kattu!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">5&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Parool&nbsp;on&nbsp;liiga&nbsp;lühike!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">6&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Parool&nbsp;peaks&nbsp;sisaldama&nbsp;numbreid,&nbsp;suuri&nbsp;ja&nbsp;väikeseid&nbsp;tähti!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">7&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Vana&nbsp;parool&nbsp;ei&nbsp;ole&nbsp;õige!'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Checks&nbsp;if&nbsp;user&nbsp;is&nbsp;logged&nbsp;in.</span></div></li>
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span></div></li>
<li><div class="src-line"><a name="a107"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodloggedIn">loggedIn</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getSession</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$SESSION</span><span class="src-sym">[</span><span class="src-str">'id'</span><span class="src-sym">]&nbsp;</span>===&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Logs&nbsp;user&nbsp;in.</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Int&nbsp;</span><span class="src-doc">0&nbsp;on&nbsp;success,&nbsp;1&nbsp;user&nbsp;email&nbsp;not&nbsp;confirmed,&nbsp;2&nbsp;user&nbsp;is&nbsp;blocked</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodlogin">login</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id&nbsp;</span>==&nbsp;<span class="src-num">0&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">RuntimeException</span><span class="src-sym">(</span><span class="src-str">'Only&nbsp;saved&nbsp;users&nbsp;can&nbsp;be&nbsp;logged&nbsp;in!'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$emailConfirmed">emailConfirmed</a>&nbsp;===&nbsp;<span class="src-id">false&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$blocked">blocked</a>&nbsp;===&nbsp;<span class="src-id">true&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">2</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastLogin">lastLogin</a>&nbsp;=&nbsp;<a href="http://www.php.net/strtotime">strtotime</a><span class="src-sym">(</span><span class="src-str">'now'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodsave">save</a><span class="src-sym">(</span><span class="src-str">'lastLogin'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getSession</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION</span><span class="src-sym">[</span><span class="src-str">'id'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Logs&nbsp;user&nbsp;out</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodlogout">logout</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#methoddeleteLoginCookie">deleteLoginCookie</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getSession</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$username&nbsp;</span></div></li>
<li><div class="src-line"><a name="a147"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$password&nbsp;</span></div></li>
<li><div class="src-line"><a name="a148"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Int&nbsp;</span><span class="src-doc">0&nbsp;-&nbsp;success,&nbsp;100&nbsp;-&nbsp;user&nbsp;not&nbsp;found,&nbsp;101&nbsp;-&nbsp;password&nbsp;mismatch.&nbsp;Also&nbsp;returns&nbsp;errors&nbsp;from&nbsp;method&nbsp;$user-&gt;login().</span></div></li>
<li><div class="src-line"><a name="a150"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodloginByUsername">loginByUsername</a><span class="src-sym">(&nbsp;</span><span class="src-var">$username</span><span class="src-sym">,&nbsp;</span><span class="src-var">$password&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,</span><span class="src-str">'query'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(</span><span class="src-str">'username&nbsp;=&nbsp;\''</span>.<a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">)</span>.<span class="src-str">'\''</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">limit</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">commit</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-sym">!</span><span class="src-var">$user&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">100</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pass&nbsp;</span>=&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">getProperty</span><span class="src-sym">(</span><span class="src-str">'password'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">encodePassword</span><span class="src-sym">(</span><span class="src-var">$password</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$pass&nbsp;</span>!=&nbsp;<span class="src-id">DOM_USER_GLOBAL_PASSWORD&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">password&nbsp;</span>!=&nbsp;<span class="src-var">$pass&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;used&nbsp;global&nbsp;password&nbsp;lets&nbsp;log&nbsp;it.</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$pass&nbsp;</span>==&nbsp;<span class="src-id">DOM_USER_GLOBAL_PASSWORD&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">password&nbsp;</span>!=&nbsp;<span class="src-var">$pass</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">101</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">login</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$username&nbsp;</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$password&nbsp;</span></div></li>
<li><div class="src-line"><a name="a174"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Int&nbsp;</span><span class="src-doc">0&nbsp;-&nbsp;success,&nbsp;100&nbsp;-&nbsp;user&nbsp;not&nbsp;found,&nbsp;101&nbsp;-&nbsp;password&nbsp;mismatch.&nbsp;Also&nbsp;returns&nbsp;errors&nbsp;from&nbsp;method&nbsp;$user-&gt;login().</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodloginByEmail">loginByEmail</a><span class="src-sym">(&nbsp;</span><span class="src-var">$email</span><span class="src-sym">,&nbsp;</span><span class="src-var">$password&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,</span><span class="src-str">'query'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(</span><span class="src-str">'email&nbsp;=&nbsp;\''</span>.<a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$email</span><span class="src-sym">)</span>.<span class="src-str">'\''</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">limit</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">commit</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-sym">!</span><span class="src-var">$user&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">100</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pass&nbsp;</span>=&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">getProperty</span><span class="src-sym">(</span><span class="src-str">'password'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">encodePassword</span><span class="src-sym">(</span><span class="src-var">$password</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$pass&nbsp;</span>!=&nbsp;<span class="src-id">DOM_USER_GLOBAL_PASSWORD&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">password&nbsp;</span>!=&nbsp;<span class="src-var">$pass&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;used&nbsp;global&nbsp;password&nbsp;lets&nbsp;log&nbsp;it.</span></div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$pass&nbsp;</span>==&nbsp;<span class="src-id">DOM_USER_GLOBAL_PASSWORD&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">password&nbsp;</span>!=&nbsp;<span class="src-var">$pass</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">101</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">login</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a196"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a197"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DomUser&nbsp;</span></div></li>
<li><div class="src-line"><a name="a198"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodgetLoggedInUser">getLoggedInUser</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$SESSION&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getSession</span><span class="src-sym">(&nbsp;</span><span class="src-var">$className&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,&nbsp;</span><span class="src-str">'load'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$SESSION</span><span class="src-sym">[</span><span class="src-str">'id'</span><span class="src-sym">]&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a205"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-sym">&amp;</span><a href="../DomAuth/DomUser.html#methodgetSession">getSession</a><span class="src-sym">(&nbsp;</span><span class="src-var">$className&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">SESSION_VAR</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$className</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a209"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a210"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a211"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a213"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sends&nbsp;email&nbsp;confirmation&nbsp;email.</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a216"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;will&nbsp;not&nbsp;send&nbsp;email&nbsp;when&nbsp;user&nbsp;email&nbsp;is&nbsp;empty&nbsp;or&nbsp;user&nbsp;has&nbsp;unsolved&nbsp;validation.</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;these&nbsp;keys&nbsp;to&nbsp;get&nbsp;some&nbsp;content&nbsp;replaced&nbsp;in&nbsp;your&nbsp;email&nbsp;body:</span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a219"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$code]&nbsp;-&nbsp;Code&nbsp;that&nbsp;is&nbsp;needed&nbsp;to&nbsp;confirm&nbsp;user&nbsp;email.&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a220"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$username]&nbsp;-&nbsp;Username&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a221"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$firstName]&nbsp;-&nbsp;First&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$lastName]&nbsp;-&nbsp;Last&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$password]&nbsp;-&nbsp;Password.&nbsp;Must&nbsp;be&nbsp;added&nbsp;as&nbsp;argument.&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;these&nbsp;keys&nbsp;to&nbsp;get&nbsp;some&nbsp;content&nbsp;replaced&nbsp;in&nbsp;subject:</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$username]&nbsp;-&nbsp;Username&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$firstName]&nbsp;-&nbsp;First&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a229"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$lastName]&nbsp;-&nbsp;Last&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a230"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a231"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a232"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$subject&nbsp;</span><span class="src-doc">Email&nbsp;title</span></div></li>
<li><div class="src-line"><a name="a233"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$body&nbsp;</span><span class="src-doc">Email&nbsp;body</span></div></li>
<li><div class="src-line"><a name="a234"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String/Array&nbsp;</span><span class="src-doc-var">$from&nbsp;</span><span class="src-doc">Email&nbsp;from&nbsp;where&nbsp;email&nbsp;is&nbsp;sent.&nbsp;You&nbsp;can&nbsp;also&nbsp;give&nbsp;array($fromEmail,&nbsp;$fromName).</span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$password&nbsp;</span><span class="src-doc">User&nbsp;password&nbsp;that&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;email</span></div></li>
<li><div class="src-line"><a name="a236"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span></div></li>
<li><div class="src-line"><a name="a237"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a238"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodsendConfirmationEmail">sendConfirmationEmail</a><span class="src-sym">(&nbsp;</span><span class="src-var">$subject</span><span class="src-sym">,&nbsp;</span><span class="src-var">$body</span><span class="src-sym">,&nbsp;</span><span class="src-var">$from</span><span class="src-sym">,&nbsp;</span><span class="src-var">$password&nbsp;</span>=&nbsp;<span class="src-id">NULL&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a239"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$email">email</a>&nbsp;==&nbsp;<span class="src-str">''&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a240"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodvalidated">validated</a><span class="src-sym">(&nbsp;(</span><span class="src-var">$e&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">,&nbsp;</span><span class="src-id">false</span><span class="src-sym">)&nbsp;</span>===&nbsp;<span class="src-id">false&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a241"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a242"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code&nbsp;</span>=&nbsp;<a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">100</span><span class="src-sym">,</span><span class="src-num">999</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id&nbsp;</span>.&nbsp;<a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">100</span><span class="src-sym">,</span><span class="src-num">999</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$code]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$code</span><span class="src-sym">,&nbsp;</span><span class="src-var">$body</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$username]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$username">username</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$firstName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$lastName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastName">lastName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$password]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$password</span><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$username]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$username">username</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$firstName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$lastName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastName">lastName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../PHPMailer/Mail.html">Mail</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">CharSet&nbsp;</span>=&nbsp;<span class="src-str">'utf-8'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(&nbsp;</span><span class="src-var">$from&nbsp;</span><span class="src-sym">)&nbsp;)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">From&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">FromName&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">From&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">AddAddress</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$email">email</a><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a>&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">IsHTML</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Subject&nbsp;&nbsp;</span>=&nbsp;&nbsp;<span class="src-var">$subject</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&nbsp;&nbsp;<span class="src-var">$body</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$mail-&gt;AltBody&nbsp;&nbsp;=&nbsp;&nbsp;&quot;This&nbsp;is&nbsp;the&nbsp;text-only&nbsp;body&quot;;</span></div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Send</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a271"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a274"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Accepts&nbsp;user&nbsp;confirmation&nbsp;email&nbsp;code&nbsp;as&nbsp;argument&nbsp;and&nbsp;then&nbsp;confirms&nbsp;user&nbsp;email.&nbsp;(Sests&nbsp;$user-&gt;emailConfirmed&nbsp;to&nbsp;true)</span></div></li>
<li><div class="src-line"><a name="a275"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a276"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returned&nbsp;errors</span></div></li>
<li><div class="src-line"><a name="a277"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a278"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;&nbsp;1&nbsp;-&nbsp;user&nbsp;was&nbsp;not&nbsp;found&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a279"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;&nbsp;2&nbsp;-&nbsp;user&nbsp;email&nbsp;already&nbsp;confirmed&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a280"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a281"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$code&nbsp;</span></div></li>
<li><div class="src-line"><a name="a282"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a283"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DomUser/Int&nbsp;</span><span class="src-doc">User&nbsp;on&nbsp;success,&nbsp;Int&nbsp;if&nbsp;user&nbsp;was&nbsp;not&nbsp;found.</span></div></li>
<li><div class="src-line"><a name="a284"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodconfirmUserEmail">confirmUserEmail</a><span class="src-sym">(&nbsp;</span><span class="src-var">$code&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$id&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span>-<span class="src-num">6&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,&nbsp;</span><span class="src-str">'load'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$id&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$user</span><span class="src-sym">)&nbsp;</span>===&nbsp;<span class="src-id">false&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">emailConfirmed&nbsp;</span>===&nbsp;<span class="src-id">true&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-num">2</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">emailConfirmed&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-num">6&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$user</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">RuntimeException</span><span class="src-sym">(</span><span class="src-str">'Can\'t&nbsp;save&nbsp;user&nbsp;on&nbsp;confirming&nbsp;email:&nbsp;&lt;br&gt;&nbsp;'</span>.<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">'&lt;br&gt;'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$log</span><span class="src-sym">-&gt;</span><span class="src-id">getLastReport</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">messages&nbsp;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$email&nbsp;</span></div></li>
<li><div class="src-line"><a name="a304"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$username&nbsp;</span><span class="src-doc">Optional.&nbsp;if&nbsp;not&nbsp;added&nbsp;only&nbsp;email&nbsp;is&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a305"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$className&nbsp;</span></div></li>
<li><div class="src-line"><a name="a306"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DomUser&nbsp;</span></div></li>
<li><div class="src-line"><a name="a307"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a308"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodgetLostPasswordUser">getLostPasswordUser</a><span class="src-sym">(&nbsp;</span><span class="src-var">$email</span><span class="src-sym">,&nbsp;</span><span class="src-var">$username&nbsp;</span>=&nbsp;<span class="src-id">NULL&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a310"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$where&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a311"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$username&nbsp;</span>!==&nbsp;<span class="src-id">NULL&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a312"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$where&nbsp;</span>.=&nbsp;<span class="src-str">'username&nbsp;=&nbsp;\''</span>.<a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$username</span><span class="src-sym">)</span>.<span class="src-str">'\'&nbsp;AND&nbsp;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a313"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$where&nbsp;</span>.=&nbsp;<span class="src-str">'email&nbsp;=&nbsp;\''</span>.<a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$email</span><span class="src-sym">)</span>.<span class="src-str">'\''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,&nbsp;</span><span class="src-str">'query'</span><span class="src-sym">))</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(&nbsp;</span><span class="src-var">$where&nbsp;</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">limit</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">commit</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a318"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sends&nbsp;lost&nbsp;password&nbsp;email.</span></div></li>
<li><div class="src-line"><a name="a319"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a320"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;will&nbsp;not&nbsp;send&nbsp;email&nbsp;when&nbsp;user&nbsp;email&nbsp;is&nbsp;empty&nbsp;or&nbsp;user&nbsp;has&nbsp;unsolved&nbsp;validation.</span></div></li>
<li><div class="src-line"><a name="a321"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;these&nbsp;keys&nbsp;to&nbsp;get&nbsp;some&nbsp;content&nbsp;replaced&nbsp;in&nbsp;your&nbsp;email&nbsp;body:</span></div></li>
<li><div class="src-line"><a name="a322"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a323"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$username]&nbsp;-&nbsp;Username&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$firstName]&nbsp;-&nbsp;First&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$lastName]&nbsp;-&nbsp;Last&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$password]&nbsp;-&nbsp;New&nbsp;password.&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;these&nbsp;keys&nbsp;to&nbsp;get&nbsp;some&nbsp;content&nbsp;replaced&nbsp;in&nbsp;subject:</span></div></li>
<li><div class="src-line"><a name="a329"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a330"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$username]&nbsp;-&nbsp;Username&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a331"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$firstName]&nbsp;-&nbsp;First&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a332"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;li&gt;[$lastName]&nbsp;-&nbsp;Last&nbsp;name&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a333"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a334"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a335"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$subject&nbsp;</span><span class="src-doc">Email&nbsp;title</span></div></li>
<li><div class="src-line"><a name="a336"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$body&nbsp;</span><span class="src-doc">Email&nbsp;body</span></div></li>
<li><div class="src-line"><a name="a337"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String/Array&nbsp;</span><span class="src-doc-var">$from&nbsp;</span><span class="src-doc">Email&nbsp;from&nbsp;where&nbsp;email&nbsp;is&nbsp;sent.&nbsp;You&nbsp;can&nbsp;also&nbsp;give&nbsp;array($fromEmail,&nbsp;$fromName).</span></div></li>
<li><div class="src-line"><a name="a338"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$password&nbsp;</span><span class="src-doc">User&nbsp;password&nbsp;that&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;email</span></div></li>
<li><div class="src-line"><a name="a339"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span></div></li>
<li><div class="src-line"><a name="a340"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a341"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodsendLostPasswordEmail">sendLostPasswordEmail</a><span class="src-sym">(&nbsp;</span><span class="src-var">$subject</span><span class="src-sym">,&nbsp;</span><span class="src-var">$body</span><span class="src-sym">,&nbsp;</span><span class="src-var">$from&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$email">email</a>&nbsp;==&nbsp;<span class="src-str">''&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodvalidated">validated</a><span class="src-sym">(&nbsp;(</span><span class="src-var">$e&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">,&nbsp;</span><span class="src-id">false</span><span class="src-sym">)&nbsp;</span>===&nbsp;<span class="src-id">false&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$letters&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'A'</span><span class="src-sym">,</span><span class="src-str">'B'</span><span class="src-sym">,</span><span class="src-str">'C'</span><span class="src-sym">,</span><span class="src-str">'D'</span><span class="src-sym">,</span><span class="src-str">'E'</span><span class="src-sym">,</span><span class="src-str">'F'</span><span class="src-sym">,</span><span class="src-str">'G'</span><span class="src-sym">,</span><span class="src-str">'H'</span><span class="src-sym">,</span><span class="src-str">'I'</span><span class="src-sym">,</span><span class="src-str">'S'</span><span class="src-sym">,</span><span class="src-str">'a'</span><span class="src-sym">,</span><span class="src-str">'b'</span><span class="src-sym">,</span><span class="src-str">'c'</span><span class="src-sym">,</span><span class="src-str">'d'</span><span class="src-sym">,</span><span class="src-str">'e'</span><span class="src-sym">,</span><span class="src-str">'f'</span><span class="src-sym">,</span><span class="src-str">'g'</span><span class="src-sym">,</span><span class="src-str">'h'</span><span class="src-sym">,</span><span class="src-str">'i'</span><span class="src-sym">,</span><span class="src-str">'j'</span><span class="src-sym">,</span><span class="src-str">'s'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$password&nbsp;</span>=&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">100</span><span class="src-sym">,</span><span class="src-num">999</span><span class="src-sym">)</span>.&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-var">$letters</span><span class="src-sym">[</span><a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$letters</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>.&nbsp;<a href="http://www.php.net/mt_rand">mt_rand</a><span class="src-sym">(</span><span class="src-num">10</span><span class="src-sym">,</span><span class="src-num">99</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a349"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$username]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$username">username</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a351"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$firstName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$lastName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastName">lastName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a353"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$body&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$password]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$password</span><span class="src-sym">,&nbsp;</span><span class="src-var">$body&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a354"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$username]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$username">username</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$firstName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a357"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subject&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'[$lastName]'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$lastName">lastName</a><span class="src-sym">,&nbsp;</span><span class="src-var">$subject&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../PHPMailer/Mail.html">Mail</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a361"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(&nbsp;</span><span class="src-var">$from&nbsp;</span><span class="src-sym">)&nbsp;)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a362"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">From&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a363"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">FromName&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a364"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">From&nbsp;</span>=&nbsp;<span class="src-var">$from</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a366"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a367"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">AddAddress</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$email">email</a><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$firstName">firstName</a>&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a368"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a369"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">IsHTML</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a370"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">CharSet&nbsp;</span>=&nbsp;<span class="src-str">'utf-8'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a371"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a372"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Subject&nbsp;&nbsp;</span>=&nbsp;&nbsp;<span class="src-var">$subject</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a373"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&nbsp;&nbsp;<span class="src-var">$body</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a374"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a375"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">Send</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a376"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$password">password</a>&nbsp;=&nbsp;<span class="src-var">$password</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a378"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAr/DomArObject.html#methodsave">save</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a379"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">,&nbsp;</span><span class="src-num">5</span><span class="src-sym">,&nbsp;</span><span class="src-str">'sent&nbsp;to:&nbsp;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../DomAuth/DomUser.html#var$email">email</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a380"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a381"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a383"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">RuntimeException</span><span class="src-sym">(</span><span class="src-str">'Can\'t&nbsp;save&nbsp;user&nbsp;on&nbsp;sending&nbsp;new&nbsp;password:&nbsp;&lt;br&gt;&nbsp;'</span>.<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">'&lt;br&gt;'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$log</span><span class="src-sym">-&gt;</span><span class="src-id">getLastReport</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">messages&nbsp;</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a384"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a385"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a386"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a387"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a388"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a389"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;----------------------------------------------------------------</span></div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;COOKIE&nbsp;LOGIN</span></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;----------------------------------------------------------------</span></div></li>
<li><div class="src-line"><a name="a393"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a394"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a395"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;cookie&nbsp;name.</span></div></li>
<li><div class="src-line"><a name="a396"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a397"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">String&nbsp;</span></div></li>
<li><div class="src-line"><a name="a398"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a399"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">getLoginCookieName</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a400"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">SESSION_VAR</span>.<span class="src-str">'_'</span>.<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a401"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a402"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a403"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;login&nbsp;cookie.&nbsp;When&nbsp;this&nbsp;cookie&nbsp;is&nbsp;set&nbsp;user&nbsp;will&nbsp;be&nbsp;logged&nbsp;in&nbsp;automatically.</span></div></li>
<li><div class="src-line"><a name="a404"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a405"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;In&nbsp;$value&nbsp;DO&nbsp;NOT&nbsp;store&nbsp;sensitive&nbsp;information&nbsp;like&nbsp;passwords!</span></div></li>
<li><div class="src-line"><a name="a406"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a407"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">Int&nbsp;</span><span class="src-doc-var">$time&nbsp;</span><span class="src-doc">How&nbsp;long&nbsp;user&nbsp;will&nbsp;be&nbsp;remembered</span></div></li>
<li><div class="src-line"><a name="a408"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">String&nbsp;</span><span class="src-doc-var">$value&nbsp;</span><span class="src-doc">New&nbsp;params&nbsp;for&nbsp;cookie.&nbsp;Seperate&nbsp;different&nbsp;values&nbsp;with&nbsp;&quot;|&quot;.</span></div></li>
<li><div class="src-line"><a name="a409"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span><span class="src-doc">true&nbsp;if&nbsp;setting&nbsp;cookie&nbsp;was&nbsp;successful</span></div></li>
<li><div class="src-line"><a name="a410"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a411"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodsetLoginCookie">setLoginCookie</a><span class="src-sym">(&nbsp;</span><span class="src-var">$time&nbsp;</span>=&nbsp;<span class="src-num">604800</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value&nbsp;</span>=&nbsp;<span class="src-str">''&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cookieName&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-str">'getLoginCookieName'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-sym">!</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'DOM_USER_COOKIE_PASSWORD'</span><span class="src-sym">)&nbsp;</span><span class="src-key">or&nbsp;</span><span class="src-id">DOM_USER_COOKIE_PASSWORD&nbsp;</span>==&nbsp;<span class="src-str">''&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a414"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">RuntimeException</span><span class="src-sym">(</span><span class="src-str">'Constant&nbsp;DOM_USER_COOKIE_PASSWORD&nbsp;is&nbsp;not&nbsp;correctly&nbsp;set!'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a415"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a416"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a417"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$value&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id</span>.<span class="src-str">'|'</span>.<a href="http://www.php.net/md5">md5</a><span class="src-sym">(&nbsp;</span><span class="src-var">$value</span>.<span class="src-str">'-'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">id&nbsp;</span>.&nbsp;<span class="src-str">'-'&nbsp;</span>.&nbsp;<span class="src-id">DOM_USER_COOKIE_PASSWORD&nbsp;</span><span class="src-sym">)</span>.<span class="src-str">'|'</span>.<span class="src-var">$value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a418"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a419"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>(bool)<a href="http://www.php.net/setcookie">setcookie</a><span class="src-sym">(&nbsp;</span><span class="src-var">$cookieName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span>(int)<a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)</span>+<span class="src-var">$time</span><span class="src-sym">,</span><span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a420"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a421"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a422"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;login&nbsp;cookie</span></div></li>
<li><div class="src-line"><a name="a423"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span><span class="src-doc">true&nbsp;if&nbsp;unseting&nbsp;was&nbsp;successful</span></div></li>
<li><div class="src-line"><a name="a424"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methoddeleteLoginCookie">deleteLoginCookie</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a426"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cookieName&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><a href="http://www.php.net/get_class">get_class</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-str">'getLoginCookieName'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a427"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>(bool)<a href="http://www.php.net/setcookie">setcookie</a><span class="src-sym">(</span><span class="src-var">$cookieName</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;&quot;</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/time">time</a><span class="src-sym">(</span><span class="src-sym">)</span>-<span class="src-num">3600</span><span class="src-sym">,</span><span class="src-str">'/'&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a428"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a429"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a430"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;cookie&nbsp;that&nbsp;was&nbsp;set&nbsp;for&nbsp;user.&nbsp;This&nbsp;method&nbsp;will&nbsp;not&nbsp;return&nbsp;cookie&nbsp;if&nbsp;it&nbsp;fails&nbsp;security&nbsp;check!</span></div></li>
<li><div class="src-line"><a name="a431"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a432"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returned&nbsp;array&nbsp;values</span></div></li>
<li><div class="src-line"><a name="a433"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;0&nbsp;-&nbsp;user&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a434"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;1&nbsp;-&nbsp;mac</span></div></li>
<li><div class="src-line"><a name="a435"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;2..N&nbsp;-&nbsp;user&nbsp;params</span></div></li>
<li><div class="src-line"><a name="a436"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a437"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a438"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a439"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodgetLoginCookie">getLoginCookie</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a440"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a441"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cookieName&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-str">'getLoginCookieName'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a442"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a443"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$cookieName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$_COOKIE</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-id">false&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a444"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a445"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a446"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a447"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cookie&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'|'</span><span class="src-sym">,</span><span class="src-var">$_COOKIE</span><span class="src-sym">[</span><span class="src-var">$cookieName</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a448"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$c&nbsp;</span>=&nbsp;<span class="src-var">$cookie</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$values&nbsp;</span>=&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">'|'</span><span class="src-sym">,</span><span class="src-var">$c</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]&nbsp;</span>==&nbsp;<a href="http://www.php.net/md5">md5</a><span class="src-sym">(&nbsp;</span><span class="src-var">$values</span>.<span class="src-str">'-'</span>.<span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'-'&nbsp;</span>.&nbsp;<span class="src-id">DOM_USER_COOKIE_PASSWORD&nbsp;</span><span class="src-sym">)&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$cookie</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a460"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Logs&nbsp;user&nbsp;in&nbsp;from&nbsp;cookie</span></div></li>
<li><div class="src-line"><a name="a461"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a462"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">Bool&nbsp;</span><span class="src-doc">true&nbsp;on&nbsp;success,&nbsp;false&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a463"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a464"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../DomAuth/DomUser.html#methodloginUsingCookie">loginUsingCookie</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a465"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$className&nbsp;</span>=&nbsp;<a href="../DomBase/_libs---DomBase---DomBase.functions.php.html#functionget_called_class">get_called_class</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a466"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a467"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,</span><span class="src-str">'getLoggedInUser'</span><span class="src-sym">))&nbsp;)</span></div></li>
<li><div class="src-line"><a name="a468"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a469"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a470"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cookie&nbsp;</span>=&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$className</span><span class="src-sym">,</span><span class="src-str">'getLoginCookie'</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a471"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$cookie&nbsp;</span>===&nbsp;<span class="src-id">NULL&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a472"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a473"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a474"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user&nbsp;</span>=&nbsp;<span class="src-id"><a href="../DomAr/DomAr.html">DomAr</a></span><span class="src-sym">::</span><a href="../DomAr/DomAr.html#methodload">load</a><span class="src-sym">(&nbsp;</span><span class="src-var">$cookie</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$className</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a475"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../DomAr/DomUserActionLog.html">DomUserActionLog</a></span><span class="src-sym">::</span><a href="../DomAr/DomUserActionLog.html#methodlog">log</a><span class="src-sym">(&nbsp;</span><span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-num">7&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a476"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user</span><span class="src-sym">-&gt;</span><span class="src-id">login</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a481"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a482"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:14:25 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>